<template>
  <div>
    <h1>兄弟组件，响应结果</h1>
    {{ count }}
    <button @click="addone">count++3333</button>
    <hr />
  </div>
</template>

<script setup>
import { storeToRefs } from 'pinia'

import useCounterStore from '../../stores/counter.js'

const counterStore = useCounterStore()
// 从对象中解构对象的属性
// 【注意】
// 被解构出的属性是响应是变量
// 只能解构属性
const { count } = storeToRefs(counterStore)
const addone = () => {
  counterStore.increment()
}
</script>

<style scoped></style>
